--开发过程中 测试模块，各种快捷键--- 客户单

local ClientOHOH = _G.ClientOHOH;

local M = ClientOHOH.class.new(script, ClientOHOH.files.BaseComponent());

local EventList = ClientOHOH.load.EventList();

EventList.DataDebug=true

local ClientEventManager = ClientOHOH.load.ClientEventManager();

local TEST_ADTA=require(script.Parent.data)



function M.new(self)
	return M(self);
end;
function M.ctor(self, playerInst)
	M.super.ctor(self, playerInst);
	if TEST_ADTA.isTest then
		self:InitDataInput()
	end
end;

local UIManager = ClientOHOH.load.UIManager();
local DebugGui=UIManager:CreateUI("DebugGui",require(script.Parent.DebugGui))

function M:InitDataInput()
	
    DebugGui:InitTestData(TEST_ADTA.data,function(...)
		self:Click(...)
	end)
	
	DebugGui:Show()
end

function M.Click(self,data,textArg)
	if data["clientActionId"] then
		local fuc=self[data["clientActionId"]]
		if fuc then
			fuc(self,textArg,data.clientArg)
		end
	end
	
	if data["serverActionId"] then
		ClientEventManager:Fire(EventList.DataDebug, data["serverActionId"],textArg,data.serverArg);
	end
end


function M.CloseMouse(self,textArg,otherArg)
end

function M.ListenInput(self,textArg,otherArg)
end


function M.Teletpot(self,textArg,otherArg)
	self.parent:IdledOutTimeTeleport()
end


function M.OpenOrCloseFriendTip(self,textArg,otherArg)
	local ctrl=self.parent:GetComponent(ClientOHOH.load.Client_RescueCtrl())
		if textArg=="1" then
			ctrl:TestOpenTip(true)
		else
			ctrl:TestOpenTip(false)
		end
end
function M.Skibi_killed(self)
	self.parent.character:SetHp(0)
end

function M.PrintTestALLDATA(self,textArg,otherArg)
	self.parent:GetComponent(_G.CommonOHOH.load.Common_ActionSynchronize()):PrintTestALLDATA()
end

function M.PrintUserData(self,textArg,otherArg)
	ClientOHOH:PrintTable(self.parent:GetComponent(_G.ClientOHOH.load.Client_PlayerDataComponent()).__save_data)	
end

function M.DebugCanUse(self,textArg,otherArg)
	
end

function M.dtor(self)
	M.super.dtor(self);
end;
return M;
